package org.beetl.sql.springboot.service;

import org.beetl.sql.springboot.Routing;
import org.beetl.sql.springboot.entity.OrderLog;
import org.beetl.sql.springboot.mapper.MyCommonMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class OrderLogService {


	@Autowired
	MyCommonMapper myCommonMapper;

	@Autowired
	Routing routing;
	public List<OrderLog> logs(String tenantId){
		routing.db(tenantId);
		return myCommonMapper.all();
	}
	public List<OrderLog> queryByName(String tenantId,String name){
		routing.db(tenantId);
		return myCommonMapper.select(name);
	}

	public OrderLog add(String tenantId,String name){
		routing.db(tenantId);
		OrderLog log = new OrderLog();
		log.setName(name);
		myCommonMapper.insert(log);
		return log;
	}

}
